package com.ruoyi.production.service.impl.regulator;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.regulator.RegulatorPurchaseApply;
import com.ruoyi.production.mapper.regulator.RegulatorPurchaseApplyMapper;
import com.ruoyi.production.service.regulator.IRegulatorPurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 调节剂购买申请Service业务层处理
 *
 * @author testlove
 * @date 2021-07-11
 */
@Service
public class RegulatorPurchaseApplyServiceImpl implements IRegulatorPurchaseApplyService
{
    @Autowired
    private RegulatorPurchaseApplyMapper regulatorPurchaseApplyMapper;

    /**
     * 查询调节剂购买申请
     *
     * @param regulatorPurchaseApplyId 调节剂购买申请ID
     * @return 调节剂购买申请
     */
    @Override
    public RegulatorPurchaseApply selectRegulatorPurchaseApplyById(Long regulatorPurchaseApplyId)
    {
        return regulatorPurchaseApplyMapper.selectRegulatorPurchaseApplyById(regulatorPurchaseApplyId);
    }

    /**
     * 查询调节剂购买申请列表
     *
     * @param regulatorPurchaseApply 调节剂购买申请
     * @return 调节剂购买申请
     */
    @Override
    public List<RegulatorPurchaseApply> selectRegulatorPurchaseApplyList(RegulatorPurchaseApply regulatorPurchaseApply)
    {
        return regulatorPurchaseApplyMapper.selectRegulatorPurchaseApplyList(regulatorPurchaseApply);
    }

    /**
     * 新增调节剂购买申请
     *
     * @param regulatorPurchaseApply 调节剂购买申请
     * @return 结果
     */
    @Override
    public int insertRegulatorPurchaseApply(RegulatorPurchaseApply regulatorPurchaseApply)
    {
        regulatorPurchaseApply.setCreateTime(DateUtils.getNowDate());
        return regulatorPurchaseApplyMapper.insertRegulatorPurchaseApply(regulatorPurchaseApply);
    }

    /**
     * 修改调节剂购买申请
     *
     * @param regulatorPurchaseApply 调节剂购买申请
     * @return 结果
     */
    @Override
    public int updateRegulatorPurchaseApply(RegulatorPurchaseApply regulatorPurchaseApply)
    {
        regulatorPurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return regulatorPurchaseApplyMapper.updateRegulatorPurchaseApply(regulatorPurchaseApply);
    }

    /**
     * 批量删除调节剂购买申请
     *
     * @param regulatorPurchaseApplyIds 需要删除的调节剂购买申请ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorPurchaseApplyByIds(Long[] regulatorPurchaseApplyIds)
    {
        return regulatorPurchaseApplyMapper.deleteRegulatorPurchaseApplyByIds(regulatorPurchaseApplyIds);
    }

    /**
     * 删除调节剂购买申请信息
     *
     * @param regulatorPurchaseApplyId 调节剂购买申请ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorPurchaseApplyById(Long regulatorPurchaseApplyId)
    {
        return regulatorPurchaseApplyMapper.deleteRegulatorPurchaseApplyById(regulatorPurchaseApplyId);
    }
}
